package com.yikome.product.repository;

import java.util.List;

import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import com.yikome.common.CommonRepository;
import com.yikome.product.entity.Product;

@Repository
public interface ProductRepository extends CommonRepository<Product, Long> {

	@Query("select t from Product t where t.yn = 1 and t.id = :productId")
	Product findByProductId(@Param("productId")Long productId);
	
	@Query("select t from Product t where t.yn = 1 and t.status = :status")
	List<Product> findStatusProduct(@Param("status")Integer status);
}
